<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .big{font-size:100px;}
        [v-clock]{display:none;}
    </style>
</head>
<body>
    <div class="app">
        <h2>hello {{ title }}</h2>
        -------
        <p class="big" v-clock>{{title}}</p>
        -------
        <p v-text="title"></p>
        <p v-html="title"></p>
        -------
        <p v-html="num"></p>
        -------
        <p v-if="flag">红色</p>
        <p v-else>绿色</p>
        -------
        <p v-if="type === 0">超级管理员</p>
        <p v-else-if="type === 1">管理员</p>
        <p v-else>用户</p>
        -------
        <p v-show="flag">显示</p>
        -------
        <p v-html="arr"></p>
        <p v-text="arr"></p>
        <p>{{arr}}</p>
        -------
        <ul>
            <li v-for="(item,idx) in arr">
                {{idx}} - {{item.city}}
            </li>
        </ul>
        -------
        <p v-pre>{{hello}}</p>
        -------
        <p v-once>
            {{ title }}
            <input type="button" value="修改" @click=change>
        </p>
        -------

    </div>
</body>
<script src="../vue.global.js"></script>
<script>

    const {createApp} = Vue;

    createApp({
        data(){
            return {
                title:"<em>Vue</em>",
                num:3,
                flag: false,
                type: 2,
                arr:[{
                    city:"北京"
                },{
                    city:"上海"
                },{
                    city:"广州"
                },{
                    city:"深圳"
                },{
                    city:"杭州"
                }]
            }
        },
        methods: {
            change(){
                this.title = "千锋";
            }
        },
    }).mount(".app");
    
</script>
</html>